Enterprise Objects Framework Release 1.1 Copyright ã1995 by NeXT Computer, Inc.  All Rights Reserved.

EOUnableToFaultToOne
(informal protocol)

Category Of:	NSObject

Declared In:	eoaccess/EOFault.h

Category Description

To-one faults, by definition, must resolve to exactly one record. If there is a possibility that the fault cannot be resolved, the relationship should be defined as a to-many. Alternatively, you can implement the unableToFaultWithPrimaryKey:entity:databaseChannel: method for your enterprise objects. This method is invoked whenever a fetch of a to-one fault does not return exactly one record. The default implementation of this method raises with NSObjectNotAvailableException; by implementing this method for your enterprise objects, you can correctly initialize the object (or raise).

Instance Methods

unableToFaultWithPrimaryKey:entity:databaseChannel:

- (void)unableToFaultWithPrimaryKey:(NSDictionary *)aKey entity:(EOEntity *)anEntity databaseChannel:(EODatabaseChannel *)aChannel

unableToFaultWithPrimaryKey:entity:databaseChannel: is called whenever the Enterprise Objects Framework is unable to resolve a to-one fault to a single database record. The Framework attempted to fetch the record from entity anEntity using primary key aKey. The attempted fetch occurred on database channel aChannel. If your enterprise objects do not implement this method, an NSObjectNotAvailableException will be raised in the event that this situation arises.